package com.naire.modul.${packageName}.action;

import java.util.ArrayList;
import java.util.List;

import net.common.action.GeneralAction;
import com.naire.modul.${packageName}.service.${className}DeleteService;
import com.naire.modul.${packageName}.service.${className}EditorService;
import com.naire.modul.${packageName}.service.${className}FindService;
import com.naire.modul.${packageName}.service.${className}SearchService;
import com.naire.modul.${packageName}.vo.${className}Vo;

public class ${className}Action extends GeneralAction {

	private static final long serialVersionUID = 7127573666355745443L;

	private ${className}Vo bean = new ${className}Vo();
	private List<${className}Vo> list = new ArrayList<${className}Vo>();
	
	public String search() throws Exception {
		${className}SearchService service = new ${className}SearchService();
		service.setPageBean(pageBean);
		service.invoke();
		list = service.getList();
		return SUCCESS;
	}
	
	public String editor() throws Exception {
		${className}EditorService service = new ${className}EditorService();
		service.setBean(bean);
		service.invoke();
		return SUCCESS;
	}
	
	public String find() throws Exception {
		if(bean.get${p_column}() != null) {			
			${className}FindService service = new ${className}FindService();
			service.setId(bean.get${p_column}());
			service.invoke();
			bean = service.getBean();
		}
		return SUCCESS;
	}
	
	public String delete() throws Exception {
		${className}DeleteService service = new ${className}DeleteService();
		service.setBean(bean);
		service.invoke();
		return SUCCESS;
	}
	
	public ${className}Vo getBean() {
		return bean;
	}
	public void setBean(${className}Vo bean) {
		this.bean = bean;
	}
	public List<${className}Vo> getList() {
		return list;
	}
	public void setList(List<${className}Vo> list) {
		this.list = list;
	}
}
